using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class testJson : MonoBehaviour {
    public GameObject button;
    public GameObject input;
	// Use this for initialization
	void Start () {
        
        button.GetComponent<Button>().onClick.AddListener(ReceiveJson);
	}
	
	// Update is called once per frame
	void Update () {
		
	}
    void ReceiveJson()
    {
        Debug.Log(input.GetComponent<InputField>().text);
        string s = input.GetComponent<InputField>().text;
        string str = MyJson.CondenceString(s);
        MyJson doc = MyJson.ParseObject(str);
        Debug.Log(doc.ToStrWithFormat());
        Debug.Log("key a value " + doc.Key("a").GetString());
    }
}
